﻿@using Abp.Application.Services.Dto;
@using FwProject.Car
@using FwProject.Car.Dto
@using X.PagedList

@model string
@{
    ViewBag.Title = "汽车管理";
}
@section styles{
    <link href="/css/print.css" rel="stylesheet" />
    <style type="text/css">
        .input-group[class*=col-] {
            padding: 0 15px;
        }
    </style>
}

<!-----------------------------【smsx.cab】打印--------------------------->
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
        codebase="/js/smsx.cab#Version=6,2,433,70"></object>
<!-----------------------------【smsx.cab】打印--------------------------->
<div align="center">
    <p class="notprint">
        <input id="Button1" type="button" value="打印" class="btnbg" onclick="pagePrint();" />
        <input id="Button2" type="button" value="预览" class="btnbg" onclick="pageView();" />
    </p>
    <div id="printObj" style="width: 190mm" align="center">
        <style>
            table {
                border-collapse: collapse;
                empty-cells: show;
                border-spacing: 0px;
            }

            #valueSpanID tbody td {
                white-space: nowrap;
            }
        </style>
        <div align="center" style="font-size: 15px; margin-top: 3px; margin-bottom: 15px; font-weight: bold;">
            <!-- 标题 -->
            <span id='titleSpan' style="font-size: 18px;">&nbsp;</span>
        </div>
        <span id='valueSpanID'>&nbsp;</span>
    </div>
</div>
    @section scripts{
        <script src="~/js/Print.js"></script>
        <script>
            var loadInfo = function () {
                var title = window.opener.getTitle();
                $('#titleSpan').text(title);//标题
                var table = window.opener.getInfo();
                $('#valueSpanID').append(table);//打印内容
                var printInit = window.opener.getprintInit();
                if (!printInit.portrait) {//横打宽度为270mm
                    $("#printObj").css({ "width": "270mm" });
                }
                p_init(printInit);
            };
            $(function () {
                loadInfo();
            });

            function pageSet() {
                try {
                    p_pagesetup();
                } catch (e) {
                    wb.execwb(8, 1);
                }
            }
            function pageView() {
                try {
                    p_preview();
                } catch (e) {
                    wb.execwb(7, 1);
                }
            }
            function pagePrint() {
                try {
                    p_print();
                } catch (e) {
                    wb.execwb(6, 6);
                }
            }
        </script>
    }
